﻿#pragma once

#include <QMainWindow>
#include "ui_UserSystem.h"
#include "users.h"
#include <QMenu>
#include <QAction>

class UserSystem : public QMainWindow
{
	Q_OBJECT

public:
	UserSystem(QWidget *parent = nullptr);
	~UserSystem();
	void SetupUserToolBar();
	
	void setCurrentUser(users user) { currentUser = user; } // 设置当前用户信息
	users getCurrentUser() const { return currentUser; } // 获取当前用户信息

	void onUserCenterAction(); // 用户中心菜单点击
	void onUserInformationAction(); // 个人信息
	void onLogoutAction(); // 退出登录
	void onUserDeleteAction(); // 用户注销
	void onPurchaseTicketsToolAction();// 购票操作
	void onRemainingTicketsSearchToolAction();// 余票查询操作
	void onOrderHistorySearchToolAction();// 历史订单查询操作
	void onTicketRefundOrChangeToolAction();// 退票/改签操作

private:
	Ui::UserSystemClass ui;
	users currentUser; // 当前用户信息
	QMenu* userCenterMenu = nullptr;
	QAction* userInfoAction = nullptr;
	QAction* logoutAction = nullptr;
	QAction* userDeleteAction = nullptr;
};

